package com.logicfishsoftware.wolfgo.api;

import java.nio.ByteBuffer;

/**
 * The {@link VirtualContentConnection} interface manages storage operations
 * within the file system.
 * 
 * @author logicfish@gmail.com
 *
 */
public interface VirtualContentConnection {

	public abstract long length(String filename) throws VirtualFileSystemException;

	public abstract void clear(String uri) throws VirtualFileSystemException;

	public abstract boolean delete(String uri) throws VirtualFileSystemException;

	public abstract void read(String fileName, ByteBuffer buffer, long offset,
			int copySize) throws VirtualFileSystemException;

	public abstract void write(String fileName, long offset, byte[] tmpBuff,
			int i, int overwriteSize) throws VirtualFileSystemException;

	public abstract void append(String fileName, byte[] tmpBuff,
			int overwriteSize, int addSize) throws VirtualFileSystemException;

	public abstract void append(String fileName, byte[] tmp);

	public abstract void truncate(String fileName, long length);

	public abstract void move(String existingFileName, String newFileName);

}